import request from '../util/request'
import { TypeDeptListAPI, TypeAllUserInfoAPI, TypeAddDeptAPI,TypeEditDeptAPI } from '../type/api'
// 获取部门列表

export function getDeptListAPI(params?: object) {
  return request.get<TypeDeptListAPI[]>('/dept/list', params || {})
}
// 获取所有用户信息
export function getAllUserInfoAPI() {
  return request.get<TypeAllUserInfoAPI[]>('/users/all/list', {})
}
// 新增部门
export function addDeptAPI(data: TypeAddDeptAPI) {
  return request.post('/dept/create', data)
}
//编辑部门
export function editDeptAPI(data: TypeEditDeptAPI) {
  return request.post('/dept/edit', data)
}
//删除部门
export function deleteDeptAPI(_id: string) {
  return request.post('/dept/delete', { _id })
}
